package com.dongzili.common.config.aspect;

import org.springframework.stereotype.Component;

@Component
public class TraceIdLogger {

    private final ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public void setTraceId(String message) {
        threadLocal.set(message);
    }

    public String getTraceId() {
        return threadLocal.get();
    }

    public void clearTraceId() {
        threadLocal.remove();
    }
}